# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libmtp
pkgver=1.1.21
pkgrel=0
pkgdesc="Software library for MTP media players"
url="https://libmtp.sourceforge.net/"
arch="all"
license="LGPL-2.0-or-later"
depends_dev="libgcrypt-dev libusb-dev"
makedepends="$depends_dev eudev-dev"
subpackages="$pkgname-dev $pkgname-examples"
source="https://download.sourceforge.net/libmtp/libmtp-$pkgver.tar.gz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-udev=/lib/udev
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

examples() {
	pkgdesc="Example programs for libmtp"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="
510f01f75de37a07c8ce54957a8fb74724538a7cfbdf1a86c201fda68573ef23fa578ff7baf2d9df938703b5776ded4ab1057c617125f3539e594bb5a1f3146f  libmtp-1.1.21.tar.gz
"
